#include<bits/stdc++.h>
using namespace std;
namespace IO{
    const int BUF=1<<21;
    char buff[BUF],*p1=buff,*p2=buff;
    #define gc() (p1==p2&&(p2=((p1=buff)+fread(buff,1,BUF,stdin)),p1==p2)?EOF:*p1++)
    template<typename T>inline void read(T &x){
        char ch=gc();x=0;int f=1;
        while(!isdigit(ch)){if(ch=='-')f=-1;ch=gc();}
        while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=gc();
        x*=f;
    }
    char obuf[BUF],*p3=obuf;
    inline void pc(char ch){
        if(p3-obuf<BUF) *p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    inline void put(const char *s){while(*s) pc(*s),++s;}
    char ch[32];int ctop;
    template<typename T>inline void print(T x){
    	if(x<0) x=~x+1,pc('-');
        if(!x) return pc(48);
        while(x) ch[++ctop]=x%10^48,x/=10;
        while(ctop) pc(ch[ctop--]);
    }
    inline void flush(){fwrite(obuf,p3-obuf,1,stdout);p3=obuf;}
}
using namespace IO;
const int N=1e5+5;
int n,m,k,vis[N],f[N],fa[N];
vector<int> G[N];
vector<vector<int>> ans;
void dfs(int p){
	vis[p]=1;
	for(int v:G[p]) if(!vis[v]){
		fa[v]=p;
		dfs(v);
		if(f[p]&&f[v]){
			vector<int> a,b;
			for(int i=f[p];i!=fa[p];i=fa[i]) a.push_back(i);
			for(int i=f[v];i!=p;i=fa[i]) b.push_back(i);
			reverse(b.begin(),b.end());
			a.insert(a.end(),b.begin(),b.end());
			ans.push_back(a);
			f[p]=0;
		}else f[p]+=f[v];
	}
}
int main(){
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	read(n),read(m),read(k);
	while(m--){
		int x,y;
		read(x),read(y);
		G[x].push_back(y);
		G[y].push_back(x);
	}
	while(k--){
		int x;read(x);
		f[x]=x;
	}
	for(int i=1;i<=n;++i) if(!vis[i]) dfs(i);
	print(ans.size()),pc('\n');
	for(auto v:ans){
		print(v.size()),pc(' ');
		for(int i:v) print(i),pc(' ');
		pc('\n');
	}
	flush();
	return 0;
}


